/*
 * OPIAM Suite
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */

package opiam.admin.faare.service.services;

import opiam.admin.faare.exception.ServiceException;


/**
 * All the services implement this interface.<br>
 * The available OPIAM-Admin services are referenced in the service.properties file.
 */
public abstract class Service
{
    /** Flag indicating if the required service is available. */
    //DW/2655/BeginPatch
    //private static boolean serviceEnabled = false;
    protected boolean serviceEnabled = false;
    //DW/2655/EndPatch

    /** Services should be utility classes with no public constructor. */
    protected Service()
    {
    }

    /**
     * Initialization method of each service.
     * This method is called by the PropertiesManager.
     * @param directory directory that contains the configuration files,
     * if this one is not in the CLASSPATH.
     *
     * @throws ServiceException in case of initialization failure
     */
    public static void initialize(String directory) throws ServiceException
    {
    }

    /**
     * This method indicates if the service is active or not.
     *
     * @return True if it is active, false otherwise.
     */
    //DW/2655/BeginPatch
    //public static boolean isServiceEnabled()
    public static boolean isServiceEnabled()
    {
        //return serviceEnabled;
        return false;
    }
    //DW/2655/EndPatch

    /**
     * Sets the state of the service.
     *
     * @param aserviceEnabled  The state of the service to set (true to enable).
     */
    //DW/2655/BeginPatch
    //public static void setServiceEnabled(boolean aserviceEnabled)
    public void setServiceEnabled(boolean aserviceEnabled)
    //DW/2655/EndPatch
    {
        serviceEnabled = aserviceEnabled;
    }
}
